<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../css/aui.css"/>
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_1141457_y8jphydgks9.css">
    <style>
        #wrapper {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 100%;
        }

        #scroller {
            margin: 0;
            padding: 0;
        }

        .item {
            width: 100%;
            height: 3.2rem;
            background: #FFFFFF;
        }

        .item:after {
            content: '';
            position: absolute;
            bottom: 0;
            background: #e0e0e0;
            width: 100%;
            height: 1px;
            -webkit-transform: scaleY(0.5);
            transform: scaleY(0.5);
            -webkit-transform-origin: 0 0;
            transform-origin: 0 0;
        }

        .item-scroller {
            width: 140%;
            position: absolute;
        }

        .content {
            width: 73%;
            height: 100%;
            float: left;
            box-sizing: border-box;
            padding-left: 0.6rem;
        }

        .content .img {
            width: 3rem;
            height: 3rem;
            float: left;
            padding-top: 0.16rem;
        }

        .content .img img {
            width: 2.4rem;
            height: 2.4rem;
            border-radius: 0.4rem;
            margin-top: 0.25rem;
        }

        .content .img .badge {
            display: inline-block;
            width: auto;
            text-align: center;
            min-width: 0.8rem;
            height: 0.8rem;
            line-height: 0.8rem;
            padding: 0 0.2rem;
            font-size: 0.6rem;
            color: #ffffff;
            background-color: #ff2600;
            border-radius: 0.4rem;
            position: absolute;
            top: 0.2rem;
            left: 2.6rem;
            z-index: 99;
        }

        .content .con {
            float: left;
            height: 2.8rem;
            padding-top: 0.5rem;
        }

        .content .con h1 {
            font-size: 0.86rem;
        }

        .content .con dd {
            font-size: 0.6rem;
            position: absolute;
            top: 0.6rem;
            width: 40%;
            text-align: right;
            right: 32%;
        }

        .content .con p {
            font-size: 0.65rem;
            position: relative;
            top: -0.1rem;
            width: 13rem;
            word-break: keep-all;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            color: #757575
        }

        .content .con span img {
            width: 0.82rem;
            display: inline;
            position: relative;
            top: 0.2rem;
        }

        .del {
            width: 27%;
            height: 3.2rem;
            float: right;
            color: #fff;
            text-align: center;
            line-height: 3.2rem;
        }

        .del .sanchu {
            width: 100%;
            height: 3.2rem;
            text-align: center;
            background: #FFB300;
            float: left;
        }

        .del .dingzhi {
            width: 50%;
            height: 3.2rem;
            text-align: center;
            background: #E51C23;
            float: left;
        }

        .aui-list .wechat-avatar {
            width: 3rem;
            z-index: 0;
        }

        .wechat-avatar, .wechat-avatar > img {
            border-radius: 8px;
        }

        .aui-list .aui-list-item-text img {
            width: 14px;
            height: 14px;
        }

        .aui-list .aui-list-item-text {
            -webkit-justify-content: flex-start;
            justify-content: flex-start;
        }

        .aui-list .aui-list-item-right {
            right: 20px;
            position: fixed;
        }

        .aui-list .aui-list-item-title {
            font-size: 0.9rem;
            position: relative;
            max-width: 100%;
            color: #212121;
        }

        .aui-list {
            border-top: none;
        }

        @media screen and (-webkit-min-device-pixel-ratio: 1.5) {
            .aui-list {
                border: none;
                background-size: 100% 0px;
            }
        }

        header {
            background-color: #fff;
            position: fixed;
            top: 0;
            width: 100%;
            z-index: 100000;
            color: #000000;
            border-bottom: 1px solid #DCDCDC;
            background: linear-gradient(-59deg, rgba(109, 67, 229, 1), rgba(169, 93, 254, 1));
        }

        .fixed-header {
            margin-top: 70px;
        }

        header ul li {
            padding-top: 20px;
            /*height: 50px;*/
            line-height: 50px;
            text-align: center;
            display: none;
            color: #fff;
            position: relative;
            font-size: 18px;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        header ul li span {
            display: block;
            text-align: center;
        }

        header ul li em {
            font-style: normal;
            float: right;
            margin-right: 10px;
            font-size: 14px;
            position: absolute;
            top: 20px;
            right: 10px;
        }

        .fixed-header {
            margin-top: 70px;
        }

        header ul li em.right {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            font-size: 14px;
            color: #fff;
            margin-right: 0;
        }

        header ul li em.right .icon {
            margin-left: 5px;
            margin-right: 0;
        }

        header ul li i {
            color: #fff;
            line-height: 50px;
            margin-left: 0 !important;
            margin-right: 0 !important;
            font-size: 16px;
            font-weight: bold;
            /* margin-right: 0; */
            position: absolute;
            top: 20px;
            left: 10px;
        }

        [v-cloak] {
            display: none;
        }

        .yuehui {

        }

        .yuehuiitem {
            width: 100%;
            height: 100px;
            border-bottom: 1px solid #f8f8f8;
            display: flex;
            justify-content: space-between;
            align-items: center;

        }

        .yuehuiiteml {
            display: flex;
            justify-content: space-between;
            align-items: center;
            height: 100px;
            margin-left: 10px;
        }

        .yuehuiiteml img {
            width: 70px;
            height: 70px;
        }

        .yuehuiiteml_right {
            width: 200px;
            height: 70px;
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            flex-direction: column;
            margin-left: 20px;

        }

        .yuehuiiteml_right .title {
            color: #333333;
            font-size: 16px;

        }

        .yuehuiiteml_right .desc {
            color: #9e9e9e;
            font-size: 14px;

        }

        .yuehuiitemr {
            margin-right: 10px;
            height: 70px;
            display: flex;
            justify-content: flex-end;
            align-items: flex-start;
            color: #a4a4a4;
            font-size: 14px;
        }

        .yuehuimessage {
            width: 84%;
            height: 60px;
            background: rgba(254, 97, 87, 0.6);
            border-radius: 15px;
            position: fixed;
            bottom: 3%;
            left: 8%;
            z-index: 1000000;
            display: flex;
            justify-content: center;
            align-items: center;
            color: #fff;
        }

        .yuehuimessage p {
            color: #fff;
            width: 75%;
            padding-left: 10px;
        }

        .yuehuimessage i {
            font-size: 24px;
        }

        .yuehuimessage2 {
            width: 100%;
            height: auto;
            padding-bottom: 10px;
            background: rgba(255, 255, 255, 1);
            border-radius: 15px;
            position: fixed;
            top: 0%;
            left: 0%;
            z-index: 1000000;
            box-shadow: 1px 2px 40px 0px rgba(161, 170, 179, 0.4);
        }

        .button_yes {
            width: 110px;
            height: 40px;
            background: linear-gradient(-59deg, rgba(109, 67, 229, 1), rgba(169, 93, 254, 1));
            box-shadow: 0px 10px 10px 0px rgba(7, 108, 224, 0.1);
            border-radius: 20px;
        }

        .button_no {
            width: 110px;
            height: 40px;
            background: rgba(204, 204, 204, 1);
            border-radius: 20px;
        }

        .yuehuimessage .title {
            font-size: 13px;
            font-family: Adobe Heiti Std R;
            font-weight: bold;
            color: rgba(34, 34, 34, 1);
            line-height: 30px;
            width: 100%;
            text-align: center;
            padding-top: 30px;
            margin-bottom: 20px;
        }

        .button_message {
            display: flex;
            width: 100%;
            justify-content: space-around;
            align-items: center;
            height: 40px;
            color: #fff;
            margin-top: 50px;
        }


        .flexcen {
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .mask {
            width: 100%;
            /*height: 100%;*/
            position: fixed;
            top: 0px;
            z-index: 1000;
            background: rgba(0, 0, 0, 0);
            /*display: block;*/
        }

        .mask2 {
            background: #fff;
            height: auto;
        }

        .mask.show {

        }

        .classno {
            padding-top: 100px;
        }

        .classno {
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            margin-top: 20%;
        }

        .classno i {
            font-size: 40px;
            margin-bottom: 20px;
            color: #999;
        }

        .classno p {
            font-size: 12px;
            color: #999;
        }

        .yuehuimessage2 {
            height: 70%;
            padding-top: 20px;
        }

        .yuehuimessage2 img {
            height: 60%;
            display: block;
            margin: auto;

        }

        .yuehuimessage2 p i {
            margin-left: 10px;
            margin-right: 3px;
        }

        .yuehuimessage2 p {
            text-align: center;
            margin-top: 10px;
            margin-bottom: 10px;
        }

        .avatar {
            width: 100%;
            height: 70%;
            background-size: 100% auto;
        }

        .yuehuimessage3 {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .yuehuil {
            width: 60px;
            height: 45px;
            border-radius: 0 20px 20px 0;
            background: #6a4ef7;
            display: flex;
            justify-content: flex-end;
            align-items: center;
            color: #fff;
        }

        .yuehuil i {
            margin-right: 10px;
            font-size: 26px;
        }

        .yuehuir {
            width: 60px;
            height: 45px;
            border-radius: 20px 0 0 20px;
            background: #f5718c;
            display: flex;
            justify-content: flex-start;
            align-items: center;
            color: #fff;
        }

        .yuehuir i {
            margin-left: 10px;
            font-size: 26px;
            color: #fff;
        }

        .userinfo_title {
            font-size: 16px;
            color: #000;
        }
    </style>
</head>
<body>
<div v-cloak id="wrapper">
    <div id="scroller"></div>
    <div class="classno" v-if="list.length==0">
        <i class="icon iconfont icon-yuehuiguangchang"></i>
        <p>暂无约会</p>
    </div>

    <div class="mask mask2" v-if="show">
        <div class="yuehuimessage2">
            <img :src="avatar" alt="">
            <!--<div class="avatar" :style="{backgroundImage:'url(' + avatar + ')'}"></div>-->
            <p class="userinfo_title">{{username}}</p>
            <p><i style="color: #003399" class="icon iconfont icon-nianling"></i>{{age}} <i style="color: #FFCCCC"
                                                                                            class="icon iconfont icon-location"></i>{{distance}}
                <i style="color: #6699CC" class="icon iconfont icon-pingfen"></i>{{score}}</p>
            <div class="yuehuimessage3">
                <div class="yuehuil" @click="fangqi">
                    <i class="icon iconfont icon-close"></i>
                </div>
                <div class="yuehuir" @click="kaolv">
                    <i class="icon iconfont icon-shoucang"></i>
                </div>
            </div>
        </div>
    </div>

    <!--<div class="mask" v-if="show">-->
    <!--<div class="yuehuimessage">-->
    <!--<i class="icon iconfont icon-close"></i>-->
    <!--<div class="title">你有一个新的约会机会</div>-->
    <!--<div class="button_message">-->
    <!--<div class="button_no flexcen" @click="fangqi">-->
    <!--放弃-->
    <!--</div>-->
    <!--<div class="button_yes flexcen" @click="kaolv">-->
    <!--考虑-->
    <!--</div>-->
    <!--</div>-->
    <!--</div>-->
    <!--</div>-->
    <div class="mask" v-if="show1">
        <div class="yuehuimessage" @click="pingjia">
            <i class="icon iconfont icon-guanzhu"></i>
            <p>你有一条新的评价</p>
            <i class="icon iconfont icon-wangxia"></i>
        </div>
    </div>
</div>
</body>
<script src="../script/api.js"></script>
<script src="../script/fastclick.js"></script>
<script src="../script/jroll.js"></script>
<script src="../script/vue2.js"></script>
<script src="../script/common.js"></script>
<script type="text/javascript">
    apiready = function () {
        function ioscheck() {
            var mam = api.require('mam');
            mam.checkUpdate(function (ret, err) {
                if (ret) {
                    var result = ret.result;
                    if (result.update == true) {//说明有更新
                        //显示更新字样提示更新
                        api.openFrame({
                            name: 'updata',
                            url: 'widget://html/updata.html',
                            bgColor: "rgba(0,0,0,0.4)",
                            rect: {
                                x: 0,
                                y: 0,
                                w: 'auto',
                                h: 'auto'
                            },
                            pageParam: {
                                version: result.version,
                                versionDes: result.versionDes,
                                source: result.source
                            }
                            //     result:
                            //         {
                            //             update:true,            //是否有更新
                            //             closed:true,            //设备上当前版本是否被强行关闭
                            //             version:'1.0',            //新版本版本号
                            //             versionDes:'',            //新版本更新描述
                            //             closeTip:'',            //提示用户应用版本被强行关闭时弹框的提示语
                            //             updateTip:'',            //提示用户有更新时弹框的提示语
                            //             source:'',                //新版本安装包的下载地址
                            //             time:''                    //新版本的发布时间
                            //         }
                            // }
                        });
                    }
                }
            });
        }

        function anzhuocheck() {
            var mam = api.require('mam');
            mam.checkSmartUpdate(function (ret, err) {
                console.log("检测更新");
                console.log(JSON.stringify(ret));
                if (ret.packages.length != 0) {
                    // var result = ret.result;
                    // alert(JSON.stringify(ret))
                    api.openFrame({
                        name: 'updata',
                        url: 'widget://html/updata.html',
                        bgColor: "rgba(0,0,0,0.4)",
                        rect: {
                            x: 0,
                            y: 0,
                            w: 'auto',
                            h: 'auto'
                        },
                        pageParam: {
                            version: ret.packages[0].incNo,
                            versionDes: ret.packages[0].extra,
                            source: '0'
                        }
                    });
                    //显示更新字样提示更新
                    // packages:[{
                    //     incNo:,            //云修复包序号
                    //     silent:,            //是否是静默更新，布尔类型
                    //     extra:,            //更新备注，字符串类型
                    // }]
                }else{
                    console.log('没有更新内容')
                }
            });
        }

        if (api.systemType == "ios") {
            ioscheck()
        } else {
            anzhuocheck()
        }

        var vm = new Vue({
            el: "#wrapper",
            data: {
                title: '忘记密码',
                show: false,
                id: '',
                uid: '',
                orderno: '',
                show1: false,
                list: [],
                username: '',
                avatar: '',
                birthday: '',
                url: '',
                score: '',
                distance: '',
                getnumber: 0

            },
            mounted: function () {
                var that = this;
                api.setCustomRefreshHeaderInfo({
                    bgColor: '#ffffff',
                    image: {
                        pull: ['widget://image/1.png', 'widget://image/2.png', 'widget://image/3.png', 'widget://image/4.png', 'widget://image/5.png', 'widget://image/6.png', 'widget://image/7.png', 'widget://image/8.png'],
                        load: ['widget://image/8.png', 'widget://image/7.png', 'widget://image/6.png', 'widget://image/5.png', 'widget://image/4.png', 'widget://image/3.png', 'widget://image/2.png', 'widget://image/1.png']
                    }
                }, function () {
                    setTimeout(function () {
                        api.refreshHeaderLoadDone();
                    }, 6000)
                });
                api.sendEvent({
                    name: 'getyuehui',
                });
                api.sendEvent({
                    name: 'getpingjia',
                });
                api.addEventListener({
                    name: 'hhxx'
                }, function (ret, err) {
                    hhxx();
                });
                // 监听约会
                api.addEventListener({
                    name: 'yuehui'
                }, function (ret, err) {
                    console.log(JSON.stringify(ret));
                    console.log(JSON.stringify(ret.value.id));
                    that.id = ret.value.id
                    that.uid = ret.value.uid
                    that.orderno = ret.value.orderno
                    that.username = ret.value.username
                    that.avatar = ajaxUrl + ret.value.avatar
                    that.birthday = ret.value.birthday
                    that.score = ret.value.score
                    that.distance = ret.value.distance
                    that.age = ret.value.age
                    that.url = ret.value.url
                    that.show = true
                });
                api.addEventListener({
                    name: 'pingjiaok'
                }, function (ret, err) {
                    api.toast({msg: '评价成功', location: 'middle'});
                });
                // 评价
                api.addEventListener({
                    name: 'pingjia'
                }, function (ret, err) {
                    console.log(JSON.stringify(ret));
                    console.log(JSON.stringify(ret.value.id));
                    that.pj_id = ret.value.id
                    that.pj_uid = ret.value.uid
                    that.nickname = ret.value.nickname
                    that.pj_orderno = ret.value.orderno
                    that.pj_avatar = ret.value.avatar
                    that.pj_birthday = ret.value.birthday
                    that.pj_gender = ret.value.gender
                    that.pj_username = ret.value.username
                    that.score = ret.value.score
                    that.age = ret.value.age
                    that.gender = ret.value.gender
                    that.show1 = true
                });
            },
            methods: {
                tiao: function () {
                    tzupdata()
                },
                fangqi: function () {
                    this.show = false
                    console.log(this.show);
                    api.sendEvent({
                        name: 'isyuehui',
                    });
                },
                fangqi1: function () {
                    this.show1 = false
                },
                kaolv: function () {
                    var that = this;
                    this.show = false
                    api.sendEvent({
                        name: 'isyuehui',
                    });
                    console.log(that.uid);
                    console.log(that.orderno);
                    api.openWin({
                        name: 'kaolv',
                        url: 'widget://html/appointment/yuehuidetail2.html',
                        slidBackType: 'edge',
                        vScrollBarEnabled: false,
                        slidBackEnabled: false,
                        pageParam: {
                            id: that.uid,
                            orderno: that.orderno
                        }
                    })
                },
                pingjia: function () {
                    var that = this;
                    this.show1 = false
                    api.openWin({
                        name: 'kaolv',
                        url: 'widget://html/appointment/pingjia.html',
                        slidBackType: 'edge',
                        vScrollBarEnabled: false,
                        slidBackEnabled: false,
                        pageParam: {
                            uid: that.pj_uid,
                            nickname: that.nickname,
                            orderno: that.pj_orderno,
                            id: that.pj_id,
                            avatar: that.pj_avatar,
                            birthday: that.pj_birthday,
                            gender: that.gender,
                            age: that.age,
                            score: that.score,
                        }
                    })
                },
            },
            filters: {
                filtersImg: function (img) {
                    var imgs = ajaxUrl + '/' + img
                    return imgs;
                },
                filtersNav: function (e) {
                    var s = parseInt(e) + 1;
                    var img = 'image/nav-' + s + '.png'
                    return img;
                }
            }
        })
        hhxx();
        api.setCustomRefreshHeaderInfo({
            bgColor: '#ffffff',
            image: {
                pull: ['widget://image/1.png', 'widget://image/2.png', 'widget://image/3.png', 'widget://image/4.png', 'widget://image/5.png', 'widget://image/6.png', 'widget://image/7.png', 'widget://image/8.png'],
                load: ['widget://image/8.png', 'widget://image/7.png', 'widget://image/6.png', 'widget://image/5.png', 'widget://image/4.png', 'widget://image/3.png', 'widget://image/2.png', 'widget://image/1.png']
            }
        }, function () {
            hhxx();
            setTimeout(function () {
                api.refreshHeaderLoadDone();
            }, 3000)
        });
        api.addEventListener({
            name: 'hhxx'
        }, function (ret, err) {
            hhxx();
        });
        api.addEventListener({
            name: 'qk'
        }, function (ret, err) {
            $api.html($api.dom('#scroller'), '');
        });
    }

    function hhxx() {
        var rong = api.require('rongCloud2');
        // 监听最新消息
        rong.getTotalUnreadCount(function (ret, err) {
            api.sendEvent({
                name: 'count',
                extra: {
                    count: ret.result
                }
            });
        })
        rong.getConversationList(function (ret, err) {
            if (ret.status == 'success') {
                var html = '';
                if (ret.result.length == 0) {
                    // hhxx()
                }
                for (var i in ret.result) {
                    var rs = ret.result[i];
                    var extra = transExtra(rs.latestMessage.extra);
                    if (rs.conversationType == 'PRIVATE' && rs.latestMessageId !== -1) {
                        if (rs.latestMessage.text == "#0#") {
                            api.sendEvent({
                                name: 'yz',
                                extra: {
                                    glid: extra.glid
                                }
                            });
                        } else if (rs.latestMessage.text == "#1#") {
                            api.sendEvent({
                                name: 'yz',
                                extra: {
                                    uid: extra.uid
                                }
                            });
                        } else {
                            if (extra.xm1 == $api.getStorage('zh')) {
                                var xm = extra.xm2;
                                var tx = extra.tx2;
                            } else {
                                var xm = extra.xm1;
                                var tx = extra.tx1;
                            }
                            if (rs.unreadMessageCount > 0 && extra.xm2 == $api.getStorage('zh')) {
                                var shu = '<div class="badge">' + rs.unreadMessageCount + '</div>';
                            } else {
                                var shu = '';
                            }
                            if (rs.objectName == 'RC:TxtMsg') {
                                xx = rs.latestMessage.text.replace(reg, function (a, b) {
                                    return face[a] ? face[a] : a;
                                });
                                var types = '<p>' + xx + '</p>'
                            } else if (rs.objectName == 'RC:ImgMsg') {
                                var types = '<p class="aui-text-success">[图像消息]</p>'
                            } else if (rs.objectName == 'RC:VcMsg') {
                                var types = '<p class="aui-text-primary">[语音消息]</p>'
                            }
                            html += '<div class="item c' + rs.targetId + '" id="a' + rs.targetId + '">';
                            html += '  <div class="item-scroller b' + rs.targetId + '">';
                            html += '    <div class="content" tapmode onclick="lt(\'' + rs.targetId + '\',\'' + xm + '\',\'' + tx + '\')">';
                            html += '      <div class="img"><img src="' + tx + '"/>' + shu + '</div>';
                            html += '      <div class="con">';
                            html += '        <dd>' + sj(rs.sentTime) + '</dd><h1>' + xm + '</h1>';
                            html += types;
                            html += '      </div>';
                            html += '    </div>';
                            html += '    <div class="del">';
                            html += '      <div class="sanchu" tapmode onclick="sanchu(\'' + rs.targetId + '\',\'PRIVATE\')">删 除</div>';
                            html += '    </div>';
                            html += '  </div>';
                            html += '</div>';
                        }
                    } else if (rs.conversationType == 'GROUP' && rs.latestMessageId !== -1) {
                        if (rs.unreadMessageCount > 0) {
                            var shu = '<div class="badge">' + rs.unreadMessageCount + '</div>';
                        } else {
                            var shu = '';
                        }
                        if (rs.objectName == 'RC:TxtMsg') {
                            xx = rs.latestMessage.text.replace(reg, function (a, b) {
                                return face[a] ? face[a] : a;
                            });
                            var types = '<p>' + xx + '</p>'
                        } else if (rs.objectName == 'RC:ImgMsg') {
                            var types = '<p class="aui-text-success">[图像消息]</p>'
                        } else if (rs.objectName == 'RC:VcMsg') {
                            var types = '<p class="aui-text-primary">[语音消息]</p>'
                        }
                        html += '<li class="aui-list-item aui-list-item-middle" onclick="qun(\'' + extra.qun_id + '\',\'' + extra.qun_zh + '\',\'' + extra.qun_tx + '\')">';
                        html += '     <div class="aui-media-list-item-inner">';
                        html += '	       <div class="aui-list-item-media wechat-avatar">';
                        html += shu;
                        html += '		        <img src="' + extra.qun_tx + '" /></div>';
                        html += '			<div class="aui-list-item-inner">';
                        html += '                <div class="aui-list-item-text">';
                        html += '                     <div class="aui-list-item-title">' + extra.qun_zh + '</div><div class="aui-list-item-right">' + sj(rs.sentTime) + '</div></div>';
                        html += types;
                        html += '           </div>';
                        html += '     </div>';
                        html += '</li>';
                        html += '<div class="item c' + rs.targetId + '" id="a' + rs.targetId + '">';
                        html += '  <div class="item-scroller b' + rs.targetId + '">';
                        html += '    <div class="content" tapmode onclick="qun(\'' + extra.qun_id + '\',\'' + extra.qun_zh + '\',\'' + extra.qun_tx + '\')">';
                        html += '      <div class="img"><img src="' + extra.qun_tx + '"/>' + shu + '</div>';
                        html += '      <div class="con">';
                        html += '        <dd>' + sj(rs.sentTime) + '</dd><h1>' + extra.qun_zh + '</h1>';
                        html += types;
                        html += '      </div>';
                        html += '    </div>';
                        html += '    <div class="del">';
                        html += '      <div class="sanchu" tapmode onclick="sanchu(\'' + rs.targetId + '\',\'PRIVATE\')">删 除</div>';
                        html += '    </div>';
                        html += '  </div>';
                        html += '</div>';
                    }
                    $api.html($api.dom('#scroller'), html);
                    api.refreshHeaderLoadDone();
                    jroll();
                    // 滚动初始化
                }
            }
        })
    }

    function lt(id, xm, tx) {
        api.openWin({
            reload: true,
            name: 'chat',
            url: 'win_chat.html',
            pageParam: {
                id: id,
                zh: xm,
                tx: tx
            },
            vScrollBarEnabled: false,
        });
        if ($api.getStorage('idd') == id) {
        } else {
            var rong = api.require('rongCloud2');
            rong.clearMessagesUnreadStatus({
                conversationType: 'PRIVATE',
                targetId: id
            }, function (ret, err) {
            })
        }
        api.sendEvent({
            name: 'hhxx'
        });
    }

    function sanchu(id, type) {
        var ida = 'a' + id.toString();
        var rong = api.require('rongCloud2');
        rong.removeConversation({
            conversationType: type,
            targetId: id
        }, function (ret, err) {
            if (ret.status == 'success') {
                $api.remove($api.byId(ida));
            }
        })
    }

    function dingzhi(id, type) {
        var idb = '.b' + id.toString();
        var idc = '.c' + id.toString();
        var html = '<div class="item" id="a' + id + '"><div class="item-scroller b' + id + '">' + $api.html($api.dom(idb.toString())) + '</div></div>';
        var rong = api.require('rongCloud2');
        rong.setConversationToTop({
            conversationType: type,
            targetId: id,
            isTop: true
        }, function (ret, err) {
            if (ret.status == 'success') {
                $api.prepend($api.byId('scroller'), html);
                $api.remove($api.dom(idc));
                jroll();
                // 滚动初始化
            }
        })
    }

    function qun(id, zh, tx) {
        api.openWin({
            reload: true,
            name: 'win_qun',
            url: 'win_qun.html',
            vScrollBarEnabled: false,
            pageParam: {
                qun_id: id,
                qun_zh: zh,
                qun_tx: tx
            }
        });
        var rong = api.require('rongCloud2');
        rong.clearMessagesUnreadStatus({
            conversationType: 'GROUP',
            targetId: id
        }, function (ret, err) {
        })
        api.sendEvent({
            name: 'hhxx'
        });
    }

    // 滚动初始化
    function jroll() {
        // 创建外层jroll实例
        var jroll = new JRoll("#wrapper", {
            scrollBarY: false
        });
        var items = document.querySelectorAll(".item");
        var current = null;
        //保存当前滑开的item
        for (var i = 0, l = items.length; i < l; i++) {
            // 每行创建jroll实例
            var j = new JRoll(items[i], {
                scrollX: true,
                bounce: false
            });
            j.on("scrollStart", function () {
                if (current && current !== this) {
                    current.scrollTo(0, 0, 100);
                    current = null;
                }
            });
            j.on("scroll", function (e) {
                if (this.x === 0 && !current) {
                    this.call(jroll, e);
                } else {
                    current = this;
                }
            });
            j.on("scrollEnd", function () {
                if (this.x > -50) {
                    this.scrollTo(0, 0, 100);
                    current = null;
                } else {
                    this.scrollTo(this.maxScrollX, 0, 100);
                }
            })
        }
        ;
        FastClick.attach(document.body);
    }

    //json格式转换
    function transExtra(arg) {
        var result = '';
        try {
            result = eval('(' + arg + ')');
        } catch (e) {
            result = arg.slice(1, -1);
        } finally {
        }
        return result;
    }

    //时间差计算
    function sj(sj) {
        var nowt = new Date().getTime();
        var a = new Date(parseInt(sj));
        var b = new Date(parseInt(nowt));
        var date1 = Date.parse(format(a, 4));
        var date2 = Date.parse(format(b, 4));
        var xxsj = Math.ceil((date2 - date1) / (60 * 1000))
        if (xxsj <= 1 && xxsj >= 0) {
            return "就刚才";
        } else if (xxsj <= 10 && xxsj > 1) {
            return xxsj + "分钟前";
        } else if (xxsj <= 60 && xxsj > 10) {
            return format(a, 1);
        } else if (xxsj <= 1440 && xxsj > 60) {
            return format(a, 1);
        } else if (xxsj <= 10080 && xxsj > 1440) {
            return format(a, 2);
        } else if (xxsj > 10080) {
            return format(a, 3);
        } else {
            return format(a, 3);
        }
    }

    //格式化时间
    function format(now, type) {
        var show_day = new Array('星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六');
        var year = now.getFullYear().toString();
        var month = (now.getMonth() + 1).toString();
        var day = (now.getDate()).toString();
        var tian = now.getDay().toString();
        var hour = (now.getHours()).toString();
        var minute = (now.getMinutes()).toString();
        var second = (now.getSeconds()).toString();
        if (hour.length == 1) {
            hour = "0" + hour;
        }
        if (minute.length == 1) {
            minute = "0" + minute;
        }
        if (second.length == 1) {
            second = "0" + second;
        }
        if (type == 1) {
            var dateTime = hour + ":" + minute;
        } else if (type == 2) {
            var dateTime = show_day[tian] + " " + hour + ":" + minute
        } else if (type == 3) {
            var dateTime = year + "-" + month + "-" + day
        } else if (type == 4) {
            var dateTime = year + "/" + month + "/" + day + " " + hour + ":" + minute + ":" + second;
        } else if (type == 5) {
            var dateTime = show_day[tian];
        }
        return dateTime;
    }

    //表情符号转换
    var reg = /\[.+?\]/g;
    var face = {
        '[微笑]': '<span><img src="../res/ChatBox/emotion/Expression_1.png"  width="28"/></span>',
        '[撇嘴]': '<span><img src="../res/ChatBox/emotion/Expression_2.png"  width="28" /></span>',
        '[色]': '<span><img src="../res/ChatBox/emotion/Expression_3.png"  width="28" /></span>',
        '[发呆]': '<span><img src="../res/ChatBox/emotion/Expression_4.png"  width="28" /></span>',
        '[得意]': '<span><img src="../res/ChatBox/emotion/Expression_5.png"  width="28" /></span>',
        '[流泪]': '<span><img src="../res/ChatBox/emotion/Expression_6.png"  width="28" /></span>',
        '[害羞]': '<span><img src="../res/ChatBox/emotion/Expression_7.png"  width="28" /></span>',
        '[闭嘴]': '<span><img src="../res/ChatBox/emotion/Expression_8.png"  width="28" /></span>',
        '[睡]': '<span><img src="../res/ChatBox/emotion/Expression_9.png"  width="28" /></span>',
        '[大哭]': '<span><img src="../res/ChatBox/emotion/Expression_10.png"  width="28"/></span>',
        '[尴尬]': '<span><img src="../res/ChatBox/emotion/Expression_11.png"  width="28"/></span>',
        '[发怒]': '<span><img src="../res/ChatBox/emotion/Expression_12.png"  width="28"/></span>',
        '[调皮]': '<span><img src="../res/ChatBox/emotion/Expression_13.png"  width="28" /></span>',
        '[呲牙]': '<span><img src="../res/ChatBox/emotion/Expression_14.png"  width="28" /></span>',
        '[惊讶]': '<span><img src="../res/ChatBox/emotion/Expression_15.png"  width="28" /></span>',
        '[难过]': '<span><img src="../res/ChatBox/emotion/Expression_16.png"  width="28" /></span>',
        '[酷]': '<span><img src="../res/ChatBox/emotion/Expression_17.png"  width="28" /></span>',
        '[冷汗]': '<span><img src="../res/ChatBox/emotion/Expression_18.png"  width="28" /></span>',
        '[抓狂]': '<span><img src="../res/ChatBox/emotion/Expression_19.png"  width="28" /></span>',
        '[吐]': '<span><img src="../res/ChatBox/emotion/Expression_20.png"  width="28" /></span>',
        '[偷笑]': '<span><img src="../res/ChatBox/emotion/Expression_21.png"  width="28" /></span>',
        '[愉快]': '<span><img src="../res/ChatBox/emotion/Expression_22.png"  width="28" /></span>',
        '[白眼]': '<span><img src="../res/ChatBox/emotion/Expression_23.png"  width="28" /></span>',
        '[傲慢]': '<span><img src="../res/ChatBox/emotion/Expression_24.png"  width="28" /></span>',
        '[饥饿]': '<span><img src="../res/ChatBox/emotion/Expression_25.png"  width="28" /></span>',
        '[困]': '<span><img src="../res/ChatBox/emotion/Expression_26.png"  width="28" /></span>',
        '[恐惧]': '<span><img src="../res/ChatBox/emotion/Expression_27.png"  width="28" /></span>',
        '[流汗]': '<span><img src="../res/ChatBox/emotion/Expression_28.png"  width="28" /></span>',
        '[憨笑]': '<span><img src="../res/ChatBox/emotion/Expression_29.png"  width="28" /></span>',
        /*从这*/
        '[悠闲]': '<span><img src="../res/ChatBox/emotion/Expression_30.png"  width="28" /></span>',
        '[奋斗]': '<span><img src="../res/ChatBox/emotion/Expression_31.png"  width="28" /></span>',
        '[咒骂]': '<span><img src="../res/ChatBox/emotion/Expression_32.png"  width="28" /></span>',
        '[疑问]': '<span><img src="../res/ChatBox/emotion/Expression_33.png"  width="28" /></span>',
        '[嘘]': '<span><img src="../res/ChatBox/emotion/Expression_34.png"  width="28" /></span>',
        '[晕]': '<span><img src="../res/ChatBox/emotion/Expression_35.png"  width="28" /></span>',
        '[疯了]': '<span><img src="../res/ChatBox/emotion/Expression_36.png"  width="28" /></span>',
        '[衰]': '<span><img src="../res/ChatBox/emotion/Expression_37.png"  width="28" /></span>',
        '[骷髅]': '<span><img src="../res/ChatBox/emotion/Expression_38.png"  width="28" /></span>',
        '[敲打]': '<span><img src="../res/ChatBox/emotion/Expression_39.png"  width="28"/></span>',
        '[再见]': '<span><img src="../res/ChatBox/emotion/Expression_40.png"  width="28"/></span>',
        '[擦汗]': '<span><img src="../res/ChatBox/emotion/Expression_41.png"  width="28"/></span>',
        '[抠鼻]': '<span><img src="../res/ChatBox/emotion/Expression_42.png"  width="28" /></span>',
        '[鼓掌]': '<span><img src="../res/ChatBox/emotion/Expression_43.png"  width="28" /></span>',
        '[糗大了]': '<span><img src="../res/ChatBox/emotion/Expression_44.png"  width="28" /></span>',
        '[坏笑]': '<span><img src="../res/ChatBox/emotion/Expression_45.png"  width="28" /></span>',
        '[左哼哼]': '<span><img src="../res/ChatBox/emotion/Expression_46.png"  width="28" /></span>',
        '[右哼哼]': '<span><img src="../res/ChatBox/emotion/Expression_47.png"  width="28" /></span>',
        '[哈欠]': '<span><img src="../res/ChatBox/emotion/Expression_48.png"  width="28" /></span>',
        '[鄙视]': '<span><img src="../res/ChatBox/emotion/Expression_49.png"  width="28" /></span>',
        '[委屈]': '<span><img src="../res/ChatBox/emotion/Expression_50.png"  width="28" /></span>',
        '[快哭了]': '<span><img src="../res/ChatBox/emotion/Expression_51.png"  width="28" /></span>',
        '[阴险]': '<span><img src="../res/ChatBox/emotion/Expression_52.png"  width="28" /></span>',
        '[亲亲]': '<span><img src="../res/ChatBox/emotion/Expression_53.png"  width="28" /></span>',
        '[吓]': '<span><img src="../res/ChatBox/emotion/Expression_54.png"  width="28" /></span>',
        '[可怜]': '<span><img src="../res/ChatBox/emotion/Expression_55.png"  width="28" /></span>',
        '[菜刀]': '<span><img src="../res/ChatBox/emotion/Expression_56.png"  width="28" /></span>',
        '[西瓜]': '<span><img src="../res/ChatBox/emotion/Expression_57.png"  width="28" /></span>',
        '[啤酒]': '<span><img src="../res/ChatBox/emotion/Expression_58.png"  width="28" /></span>',
        '[篮球]': '<span><img src="../res/ChatBox/emotion/Expression_59.png"  width="28" /></span>',
        '[乒乓]': '<span><img src="../res/ChatBox/emotion/Expression_60.png"  width="28" /></span>',
        '[咖啡]': '<span><img src="../res/ChatBox/emotion/Expression_61.png"  width="28" /></span>',
        '[饭]': '<span><img src="../res/ChatBox/emotion/Expression_62.png"  width="28" /></span>',
        '[猪头]': '<span><img src="../res/ChatBox/emotion/Expression_63.png"  width="28" /></span>',
        '[玫瑰]': '<span><img src="../res/ChatBox/emotion/Expression_64.png"  width="28" /></span>',
        '[凋谢]': '<span><img src="../res/ChatBox/emotion/Expression_65.png"  width="28" /></span>',
        '[嘴唇]': '<span><img src="../res/ChatBox/emotion/Expression_66.png"  width="28" /></span>',
        '[爱心]': '<span><img src="../res/ChatBox/emotion/Expression_67.png"  width="28" /></span>',
        '[心碎]': '<span><img src="../res/ChatBox/emotion/Expression_68.png"  width="28"/></span>',
        '[蛋糕]': '<span><img src="../res/ChatBox/emotion/Expression_69.png"  width="28"/></span>',
        '[闪电]': '<span><img src="../res/ChatBox/emotion/Expression_70.png"  width="28"/></span>',
        '[炸弹]': '<span><img src="../res/ChatBox/emotion/Expression_71.png"  width="28" /></span>',
        '[刀]': '<span><img src="../res/ChatBox/emotion/Expression_72.png"  width="28" /></span>',
        '[足球]': '<span><img src="../res/ChatBox/emotion/Expression_73.png"  width="28" /></span>',
        '[瓢虫]': '<span><img src="../res/ChatBox/emotion/Expression_74.png"  width="28" /></span>',
        '[便便]': '<span><img src="../res/ChatBox/emotion/Expression_75.png"  width="28" /></span>',
        '[月亮]': '<span><img src="../res/ChatBox/emotion/Expression_76.png"  width="28" /></span>',
        '[太阳]': '<span><img src="../res/ChatBox/emotion/Expression_77.png"  width="28" /></span>',
        '[礼物]': '<span><img src="../res/ChatBox/emotion/Expression_78.png"  width="28" /></span>',
        '[拥抱]': '<span><img src="../res/ChatBox/emotion/Expression_79.png"  width="28" /></span>',
        '[强]': '<span><img src="../res/ChatBox/emotion/Expression_80.png"  width="28" /></span>',
        '[弱]': '<span><img src="../res/ChatBox/emotion/Expression_81.png"  width="28" /></span>',
        '[握手]': '<span><img src="../res/ChatBox/emotion/Expression_82.png"  width="28" /></span>',
        '[胜利]': '<span><img src="../res/ChatBox/emotion/Expression_83.png"  width="28" /></span>',
        '[抱拳]': '<span><img src="../res/ChatBox/emotion/Expression_84.png"  width="28" /></span>',
        '[勾引]': '<span><img src="../res/ChatBox/emotion/Expression_85.png"  width="28" /></span>',
        '[拳头]': '<span><img src="../res/ChatBox/emotion/Expression_86.png"  width="28" /></span>',
        '[差劲]': '<span><img src="../res/ChatBox/emotion/Expression_87.png"  width="28" /></span>',
        '[爱你]': '<span><img src="../res/ChatBox/emotion/Expression_88.png"  width="28" /></span>',
        '[NO]': '<span><img src="../res/ChatBox/emotion/Expression_89.png"  width="28" /></span>',
        '[OK]': '<span><img src="../res/ChatBox/emotion/Expression_90.png"  width="28" /></span>',
        '[爱情]': '<span><img src="../res/ChatBox/emotion/Expression_91.png"  width="28" /></span>',
        '[飞吻]': '<span><img src="../res/ChatBox/emotion/Expression_92.png"  width="28" /></span>',
        '[跳跳]': '<span><img src="../res/ChatBox/emotion/Expression_93.png"  width="28" /></span>',
        '[发抖]': '<span><img src="../res/ChatBox/emotion/Expression_94.png"  width="28" /></span>',
        '[怄火]': '<span><img src="../res/ChatBox/emotion/Expression_95.png"  width="28" /></span>',
        '[转圈]': '<span><img src="../res/ChatBox/emotion/Expression_96.png"  width="28" /></span>',
        '[磕头]': '<span><img src="../res/ChatBox/emotion/Expression_97.png"  width="28"/></span>',
        '[回头]': '<span><img src="../res/ChatBox/emotion/Expression_98.png"  width="28"/></span>',
        '[跳绳]': '<span><img src="../res/ChatBox/emotion/Expression_99.png"  width="28"/></span>',
        '[投降]': '<span><img src="../res/ChatBox/emotion/Expression_100.png"  width="28" /></span>',
        '[激动]': '<span><img src="../res/ChatBox/emotion/Expression_101.png"  width="28" /></span>',
        '[街舞]': '<span><img src="../res/ChatBox/emotion/Expression_102.png"  width="28" /></span>',
        '[献吻]': '<span><img src="../res/ChatBox/emotion/Expression_103.png"  width="28" /></span>',
        '[左太极]': '<span><img src="../res/ChatBox/emotion/Expression_104.png"  width="28" /></span>',
        '[右太极]': '<span><img src="../res/ChatBox/emotion/Expression_105.png"  width="28" /></span>'
    };
</script>
</html>
